package wortubung.core;

public abstract class FixedUsage implements Item {
	private WORD word;
	private String expression;
	private MEANING meaning;
	private transient boolean needReplace;

	public FixedUsage(WORD word, String expression) {
		this.word = word;
		this.expression = expression;
		this.needReplace = expression.contains("~");
	}

	public String getExpression() { return expression; }
	public String getFullExpression() { return needReplace ? expression.replaceAll("~", word.getWord()) : expression; }
	public MEANING getMeaning() { return meaning; }

	@Override
	public void addDefinition(MEANING def) { meaning = def; }
}
